#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main (void)
{
	pid_t pid = fork ();
	if (-1 == pid) {
		perror ("fork()");
		return -1;
	}
	if (0 == pid) {
		printf ("child pid: %d\n", getpid());
		getchar ();
	} else {
		printf ("parent pid:%d\n", getpid ());
	}
	return 0;
}

